﻿using System;
using System.Data;
using System.Data.SqlClient;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class ReportList : System.Web.UI.Page
{
    Xqsys.MODEL.Report report = new Xqsys.MODEL.Report();
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["se1"] == null)
        {
            lit.Text = "<script>alert('请登录');</script>";
        }
        else
        {
            loginname.Text = Session["se1"].ToString();
            if (Session["se1"] == null)
            {
                lit.Text = "<script>alert('请登录');</script>";
                Response.Redirect("~/index.aspx");
            }
            else
            {
                loginname.Text = Session["se1"].ToString();
                getdata();
                if (Session["Role"].ToString() == "2")
                {
                    Panel1.Visible = true;
                    Panel2.Visible = true;
                    Panel3.Visible = true;
                }
                else
                {
                    Panel1.Visible = false;
                    Panel2.Visible = false;
                    Panel3.Visible = false;
                }
            }
        }
    }
    protected void zhuxiao_Click(object sender, EventArgs e)
    {
        Session.Clear();
        Response.Redirect("~/index.aspx");
    }

    private void getdata()
    {
        PageControl1.DataSource = (IEnumerable)((new Xqsys.BLL.Report().GetAllReport()).Tables[0].DefaultView);
        PageControl1.pageSize = 15;
        PageControl1.datalist = ReportDataList;
        PageControl1.PageDataBind();
    }

    protected void LinkButton3_Click(object sender, EventArgs e)
    {
    {
        getdata();

    }
    protected void LinkButton2_Click(object sender, EventArgs e)
    {
        PageControl1.DataSource = (IEnumerable)(((DataSet)new Xqsys.DAL.Report().GetAllReport()).Tables[0].DefaultView);
        PageControl1.pageSize = 15;
        PageControl1.datalist = ReportDataList;
        PageControl1.PageDataBind();
    }
    protected void Button3_Click(object sender, EventArgs e)
    {

    }
    protected void LinkButton4_Click(object sender, EventArgs e)
    {

    }
    protected void DropDownList3_SelectedIndexChanged(object sender, EventArgs e)
    {

    }
    protected void Button2_Click(object sender, EventArgs e)
    {
        Response.Redirect("~/Report.aspx");
    }
}